package testview.zhen.com.myapplication.readsource.okhttp

import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit

class OkHttpUtils private constructor(){
    companion object{
        private var mInstance:OkHttpUtils?=null
       fun getInstance():OkHttpUtils{
           if (mInstance == null){
               synchronized(OkHttpUtils::class.java){
                   if (mInstance == null){
                       mInstance = OkHttpUtils()
                   }
               }
           }
           return mInstance!!
       }
    }
    //基本封装 并未考虑加入其它的信息
     fun getClient():OkHttpClient{
      return  OkHttpClient.Builder().connectTimeout(5,TimeUnit.SECONDS)
                .connectTimeout(5, TimeUnit.SECONDS)
                .writeTimeout(10,TimeUnit.SECONDS)
                .readTimeout(10, TimeUnit.SECONDS)
                .build()
    }





}